﻿@using SmartStore.Web.Framework.UI;

@* Please keep in mind that this layout view is also referenced and used by plugins! *@

@{
	Layout = "_AdminRoot";
}

@if (ViewBag.RefreshPage == true)
{
	<script>
		try {
			window.parent.document.forms['@(ViewBag.formId)'].@(ViewBag.btnId).click();
		}
		catch (e) {
			try { window.parent.document.getElementById('@(ViewBag.btnId)').click(); }
			catch (e2) { }
		}

		@if (!(ViewBag.CloseWindow == false))
		{
			<text>window.parent.closePopup();</text>
		}
	</script>
}

<div id="page">
	@if (ViewData["warning.panel.message"] != null)
	{
		<div class="alert warning-panel-message">
			@Html.Raw(ViewData["warning.panel.message"])
			<button type="button" class="close" data-dismiss="alert">&times;</button>
		</div>
	}

	<div class="page-main">
		@if (IsSectionDefined("header"))
		{
			@RenderSection("header")
		}
		else
		{
			<header id="header">
				@if (IsSectionDefined("navbar"))
				{
					@RenderSection("navbar")
				}
				else
				{
					Html.RenderWidget("admin_navbar_before");
					Html.RenderAction("Navbar", "Common", new { area = "Admin" });
					Html.RenderWidget("admin_navbar_after");
				}

				<div id="breadcrumb">
					<!-- SiteMapPath here-->
					@{ Html.RenderWidget("admin_breadcrumb"); }
				</div>
			</header>
		}

		@{ Html.RenderZone("beforemaincontent"); }

		<div id="content">
			<div class="cph">
				@{ Html.RenderWidget("admin_content_before"); }
				@RenderBody()
			</div>
			<div id="ajax-busy">
				<div class="bar"></div>
				<div class="bar"></div>
				<div class="bar"></div>
			</div>
		</div>

		@{ Html.RenderZone("aftermaincontent"); }
	</div>

	@{ Html.RenderWidget("admin_content_after"); }
</div>

@{ Html.RenderPartial("_Notifications"); }